/*=+--+=#=+--     Unmanned Aerial System Management Software      --+=#=+--+=#*\
|          Copyright (C) 2011 Regents of the University of Colorado.           |
|                             All Rights Reserved.                             |

     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License version 2 as
     published by the Free Software Foundation.

     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.

     You should have received a copy of the GNU General Public License
     along with this program.  If not, see <http://www.gnu.org/licenses/>.

            Jack Elston                       Cory Dixon                        
|           elstonj@colorado.edu              dixonc@colorado.edu              |
|                                                                              |
\*=+--+=#=+--                 --+=#=+--+=#=+--                    --+=#=+--+=#*/

/*!
  \file XMLtoData.h
	\brief header file for XML parser

                    \author Jack Elston
             $Date: 2006/10/25 13:34:45 $
*/

#ifndef __XMLTODATA_H
#define __XMLTODATA_H

#include <unistd.h>
#include <signal.h>
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <math.h>

#include "String.h"
#include "command.h"
#include "queue.h"
#include "type_defs.h"
#include "threadedPipe.h"
#include "shmStruct.h"

#include <xercesc/util/PlatformUtils.hpp>

  /*<-------Defines--------->*/
  /*<------End Defines------>*/

/************************************************************\
|                    XMLtoData_Parser                        |
\************************************************************/
/*!
  \class XMLtoData_Parser
  \brief reads XML data from a fifo, parses it and places it
   into an appropriate outgoing fifo
  \todo switch statement need to be implemented to handle different types of incomming data
  \todo switch statement need to be implemented to handle different types of tasks (other than "Loiter").
  \todo waypoint.part0.Alt=1800 is statically set
  \todo waypoint.part1.OrbitRad=50 is statically set
  \todo waypoint.part1.Next is set to 0 - This is a hack to make piccolo integration work (Since the piccolo requries at least two points to make a flightplan).
 */
class XMLtoData_Parser : public ThreadedPipe
{
private:
  void parse(int num);

public:
	XMLtoData_Parser(String name);

	~XMLtoData_Parser();

  ThreadedPipe::commMode mode();
	void update();
};

#endif //define
